function compose(...funcs) {
    return funcs.reduce((wrap, current) => {
        return args => {
            return wrap(current(args))
        }
    })
}

function a(obj) {
	obj.a = 1;
	return obj;
}
function b(obj) {
	obj.b = 1;
	return obj;
}
function c(obj) {
	obj.c = 1;
	return obj;
}
let res = compose(a, b, c);